package org.springmvc.entity;

import org.springmvc.entity.enumeration.Gender;
import org.springmvc.entity.enumeration.Marriage;
import org.springmvc.mybatis.handler.MapTypeHandler;

import javax.persistence.Column;
import java.util.Map;

/**
 * @author tangjialin on 2016-05-31 0031.
 */
public class User extends BaseEntity<User> {
    private String openId;
    private Gender gender;
    private Marriage marriage;
    /**
     * 规则处理器扩展属性(JSON格式的字符串),详见 {@link MapTypeHandler}
     * 复杂类型的字段,必须添加 @Column 注解才能持久化到数据库
     */
    @Column
    private Map<String, Object> properties;

    public String getOpenId() {
        return openId;
    }

    public User setOpenId(String openId) {
        this.openId = openId;
        return this;
    }

    public Gender getGender() {
        return gender;
    }

    public User setGender(Gender gender) {
        this.gender = gender;
        return this;
    }

    public Marriage getMarriage() {
        return marriage;
    }

    public User setMarriage(Marriage marriage) {
        this.marriage = marriage;
        return this;
    }

    public Map<String, Object> getProperties() {
        return properties;
    }

    public User setProperties(Map<String, Object> properties) {
        this.properties = properties;
        return this;
    }
}
